<template>
	<div class="login">
		<view class="details"></view>
		<view class="title"> 应缴金额 </view>
		<view class="title"> {{details.amount}}元 </view><hr/>
		<view class="idQuery">
			<view >
				<text>缴费户名</text>
				<text class="detailsRight">{{details.name}}</text>
			</view>
			<view >
				<text>缴费户号</text>
				<text class="detailsRight">{{details.num}}</text>
			</view>
			<view >
				<text>缴费单位</text>
				<text class="detailsRight">{{details.company}}</text>
			</view>
			<view >
				<text>用户地址</text>
				<text class="detailsRight">{{details.address}}</text>
			</view>
			<view >
				<text>选择缴费方式</text>
				<text class="detailsRight">
					{{details.mode}}
					<text class="weixin"></text>
				</text>
			</view>
			<!-- <input class="inputStyle" name="num" placeholder="￥输入金额" v-model="item.amount" /> -->
		</view>
		<view>
			<button type="default" form-type="submit" class="loginBtn" @click="det">立即缴费</button>
		</view>
	</div>
</template>

<script>
	const {details} = require('../../utils/api.js')
	export default {
		data() {
			return {
				text: 'uni-app',
				numData:{
					num:''
				},
				details:{}
			}
		},
		onLoad: function (options) {
			setTimeout(function () {
				console.log('start pulldown');
			}, 1000);
			uni.startPullDownRefresh();
		},
		onPullDownRefresh() {
			console.log('refresh');
			setTimeout(function () {
				uni.stopPullDownRefresh();
			}, 1000);
		},
		created() {
			this.getDetails();
		},
		methods:{
			getDetails(){
				this.numData.num = uni.getStorageSync('num');
				details(this.numData).then(data=>{
					this.details = data.msg[0]
				})
			},
			det(){
				// uni.requestPayment({
				//     provider: 'alipay',
				//     orderInfo: 'orderInfo', //微信、支付宝订单数据 【注意微信的订单信息，键值应该全部是小写，不能采用驼峰命名】
				//     success: function (res) {
				//         console.log('success:' + JSON.stringify(res));
				//     },
				//     fail: function (err) {
				//         console.log('fail:' + JSON.stringify(err));
				//     }
				// });
				uni.navigateTo({
					url: 'success'
				});
			}
		}
	}
</script>

<style scoped src="../../static/css/login.css"></style>
